package top.ysh.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import top.ysh.domain.User;
import top.ysh.mapper.UserMapper;
import top.ysh.service.UserService;

import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    /**
     * 查询所有用户信息
     * @return
     */
    @Override
    public List<User> findAll() {
        return userMapper.findAll();
    }

    /**
     * 新增用户信息
     *
     * @param user
     * @return
     */
    @Override
    public boolean save(User user) {
        return userMapper.save(user);
    }

    /**
     * 修改用户信息
     *
     * @param user
     * @return
     */
    @Override
    public boolean update(User user) {
        return userMapper.update(user);
    }

    /**
     * 删除用户
     *
     * @param uuid
     * @return
     */
    @Override
    public boolean delete(Integer uuid) {
        return userMapper.delete(uuid);
    }
}
